//
//  HDMNTabBarController.m
//  MyViews
//
//  Created by 孙志洪 on 2016/10/17.
//  Copyright © 2016年 HDMN. All rights reserved.
//

#import "HDMNTabBarController.h"
#import "HDMNMeVC.h"
#import "HDMNTimeVC.h"
@interface HDMNTabBarController ()

@end

@implementation HDMNTabBarController
+(void)load{
    UITabBarItem *item = [UITabBarItem appearanceWhenContainedIn:self, nil];
    //富文本
    NSMutableDictionary *attr = [NSMutableDictionary dictionary];
    //颜色
    attr[NSForegroundColorAttributeName] = [UIColor blueColor];

    [item setTitleTextAttributes:attr forState:UIControlStateSelected];
    NSMutableDictionary *attrnormal = [NSMutableDictionary dictionary];
    // 字体
    attrnormal[NSFontAttributeName] = [UIFont systemFontOfSize:18];
    [item setTitleTextAttributes:attrnormal forState:UIControlStateNormal];
    
    

}
- (void)viewDidLoad {
    [super viewDidLoad];
    //添加子控制器
    [self ChildViewController];
    
    [self ChildTitle];
    
    
}
-(void)ChildViewController{
    HDMNMeVC *me = [[HDMNMeVC alloc]init];
    UINavigationController *meNav = [[UINavigationController alloc]initWithRootViewController:me];
    [self addChildViewController:meNav];
    
    HDMNTimeVC *time = [[HDMNTimeVC alloc]init];
    UINavigationController *timeNav = [[UINavigationController alloc]initWithRootViewController:time];
    [self addChildViewController:timeNav];
    

}
-(void)ChildTitle{
    UINavigationController *nav = self.childViewControllers[0];
    nav.tabBarItem.title = @"我";
    NSDictionary *dictHome = [NSDictionary dictionaryWithObject:[UIColor blackColor] forKey:NSForegroundColorAttributeName];
    [nav.tabBarItem setTitleTextAttributes:dictHome forState:UIControlStateSelected];
    nav.tabBarItem.image = [UIImage imageNamed:@"actor_default_44x45_"];
    nav.tabBarItem.selectedImage = [UIImage imageNamed:@"actor_selected_44x45_"];
    
    
    UINavigationController *navw = self.childViewControllers[1];
    navw.tabBarItem.title = @"时间";
    NSDictionary *time = [NSDictionary dictionaryWithObject:[UIColor blackColor] forKey:NSForegroundColorAttributeName];
    [navw.tabBarItem setTitleTextAttributes:time forState:UIControlStateSelected];
    navw.tabBarItem.image = [UIImage imageNamed:@"movie_ticket_default_44x44_"];
    navw.tabBarItem.selectedImage = [UIImage imageNamed:@"movie_ticket_highlighted_44x44_"];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
